<?php

namespace app\admin\model\club;

use think\Model;


class Course extends Model
{

    

    

    // 表名
    protected $name = 'club_course';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'status_text'
    ];
    
    public function getShowfrontList()
    {
        return [
            '开启' => __('开启'),
            '关闭' => __('关闭')
        ];
    }
    
    public function getStatusList()
    {
        return [
            '开启' => __('报名中'), 
            '关闭' => __('报名结束')  
        ]; 
    }
    
    public function getCategoryList()
    {
        return [
            '网球' => __('网球'), 
            '化妆' => __('化妆')
        ];
    }
    

    public function getStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
        $list = $this->getStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }


}
